#import "~/graphql_shared/fragments/page_info.fragment.graphql"

query getComplianceViolations(
  $fullPath: ID!
  $filters: ComplianceViolationInput
  $sort: ComplianceViolationSort
  $after: String
  $before: String
  $first: Int
  $last: Int
) {
  group(fullPath: $fullPath) {
    id
    mergeRequestViolations(
      filters: $filters
      sort: $sort
      after: $after
      before: $before
      first: $first
      last: $last
    ) {
      nodes {
        id
        severityLevel
        reason
        violatingUser {
          id
          name
          username
          avatarUrl
          webUrl
        }
        mergeRequest {
          id
          title
          mergedAt
          webUrl
          author {
            id
            name
            username
            avatarUrl
            webUrl
          }
          mergeUser {
            id
            name
            username
            avatarUrl
            webUrl
          }
          committers {
            nodes {
              id
              name
              username
              avatarUrl
              webUrl
            }
          }
          participants {
            nodes {
              id
              name
              username
              avatarUrl
              webUrl
            }
          }
          approvedBy {
            nodes {
              id
              name
              username
              avatarUrl
              webUrl
            }
          }
          ref: reference
          fullRef: reference(full: true)
          sourceBranch
          sourceBranchExists
          targetBranch
          targetBranchExists
          project {
            id
            avatarUrl
            name
            webUrl
            complianceFrameworks {
              nodes {
                id
                name
                description
                color
              }
            }
          }
        }
      }
      pageInfo {
        ...PageInfo
      }
    }
  }
}
